<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>注册--编程之友BBS</title>
    <link rel="stylesheet" type="text/css" href="style/top.css" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/footer.css" />
    <link rel="stylesheet" type="text/css" href="style/reglog.css" />
    <script src="script/jquery.js" type="text/javascript"></script>
	<script src="script/jquery.validate.js" type="text/javascript"></script>
	
	<script type="text/javascript">

			
		$().ready(function() {
			
			
			// validate signup form on keyup and submit
			$("#iform").validate({
				rules: {
					username: {
						required: true,
						minlength: 2
					},
					userpwd: {
						required: true,
						minlength: 5
					},
					userpwd2: {
						required: true,
						minlength: 5,
						equalTo: "#userpwd"
					},
					email: {
						required: true,
						email: true
					},
					validatecode: {
						required: true
					}
				},
				messages: {
					username: {
						required: "请输入用户名！",
						minlength: "您的用户名必须不少于2位！"
					},
					userpwd: {
						required: "请输入密码！",
						minlength: "您的密码必须不少于5位！"
					},
					userpwd2: {
						required: "请确认您的密码！",
						minlength: "您的确认密码必须不少于5位！",
						equalTo: "您的确认密码必须与密码一致！"
					},
					email: "请输入正确的email！",
					validatecode: "请输入验证码！"
				}
			});
			
		});
	</script>
    
  </head>
  
  <body>
    <!-- 网页头部 -->
    <%@include file="template/head.jsp" %>
    
    <!-- 网页主体 -->
    <div class="bd">
		<h3>注册</h3>
    	<div class="bd_left">
    		<form id="iform" class="cform" action="user.jspx?_method=register" method="post">
        		<div>
        			<label class="lb" for="username">用户名　：</label><input id="username" class="inp" type="text" name="username" /><br/>
        		</div>
        		<div>
        			<label class="lb" for="userpwd">密　码　：</label><input id="userpwd" class="inp" type="password" name="userpwd" /><br/>
        		</div>
        		<div>
        			<label class="lb" for="userpwd2">确认密码：</label><input id="userpwd2" class="inp" type="password" name="userpwd2" /><br />
        		</div>
        		<div>
        			<label class="lb" for="email">email 　：</label><input id="email" class="inp" type="text" name="email"  /><br />
        		</div>
        		<div>
        			<label class="lb" for="validatecode">验证码    ：</label><input id="validatecode" class="inp" type="text" name="validatecode" /><br />
        		</div>
        		<div>
        			<label class="lb"></label><div><img src="jcaptcha.jpg" alt="验证码"/></div>
        		</div>
        		<div>
        			<input type="submit" value="提交" />
        		</div>
        	</form>
    	</div>
   		<div class="bd_right">
    		<span class="tologin">有账号了？去<a href="index.jspx?_method=login">登陆</a></span>
    	</div>
    	<c:if test="${not empty msg}">
    		<h4 style="color:red">${msg }</h4>
    		<c:remove var="msg" scope="session"/>
    	</c:if>
    	<div class="clear"></div>
	</div>
    
    
    <!-- 网页底部 -->
    <%@include file="template/footer.jsp" %>
  </body>
</html>
